@extends('admin.container')

@section('c-body')
    <div class="am-g">
        <div class="am-u-md-12">
            <form class="am-form am-form-horizontal" method="post" action="{{ route('admin.goods.category') }}">
                {!! csrf_field() !!}
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">分类名称</label>
                    <div class="am-u-sm-9">
                        <input type="text" id="user-name" placeholder="分类名称" name="name">
                     </div>
                </div>
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">父分类</label>
                    <div class="am-u-sm-9">
                        <select name="parent_id">
                            <option value="0">顶层</option>
                            @include('admin.site.category.category-list', ['categories' => $categories, 'level' => 0])
                        </select>

                     </div>
                </div>
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">显示</label>
                    <div class="am-u-sm-9">
                        是<input type="radio" id="user-name" name="display" value="1">
                        否<input type="radio" id="user-name" name="display" value="0">
                    </div>
                </div>
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">排序</label>
                    <div class="am-u-sm-9">
                        <input type="text" id="user-name" placeholder="排序大小" name="sort">
                    </div>
                </div>

                <div class="am-u-sm-9 am-u-sm-push-3">
                    <button type="submit" class="am-btn am-btn-primary am-radius">添加分类</button>
                </div>
            </form>
        </div>
    </div>
@stop

@section('c-foot')
    <script>
        $(function() {
            $('#business_logo').on('change', function() {
                var fileNames = '';
                $.each(this.files, function() {
                    fileNames += '<span class="am-badge">' + this.name + '</span> ';
                });
                $('#file-list-business_logo').html(fileNames);
            });
            $('#member_logo').on('change', function() {
                var fileNames = '';
                $.each(this.files, function() {
                    fileNames += '<span class="am-badge">' + this.name + '</span> ';
                });
                $('#file-list-member_logo').html(fileNames);
            });
            $('#web_logo').on('change', function() {
                var fileNames = '';
                $.each(this.files, function() {
                    fileNames += '<span class="am-badge">' + this.name + '</span> ';
                });
                $('#file-list-web_logo').html(fileNames);
            });
        });
    </script>
@stop